﻿using System.Diagnostics.Contracts;
using System.Windows.Threading;

namespace System.Reactive.Concurrency
{
	public class DispatcherScheduler : LocalScheduler
	{
		public static DispatcherScheduler Instance
		{
			get
			{
				Contract.Ensures(Contract.Result<DispatcherScheduler>() != null, null, "Contract.Result<DispatcherScheduler>() != null");
				return null;
			}
		}

		public Dispatcher Dispatcher
		{
			get
			{
				Contract.Ensures(Contract.Result<Dispatcher>() != null, null, "Contract.Result<Dispatcher>() != null");
				return null;
			}
		}

		public DispatcherScheduler(Dispatcher dispatcher)
		{
			Contract.Requires(dispatcher != null, null, "dispatcher != null");
			Contract.Ensures(object.ReferenceEquals(this.Dispatcher, dispatcher), null, "object.ReferenceEquals(this.Dispatcher, dispatcher)");
		}

#if !SILVERLIGHT
		public DispatcherScheduler(Dispatcher dispatcher, DispatcherPriority priority)
		{
			Contract.Requires(dispatcher != null, null, "dispatcher != null");
			Contract.Ensures(object.ReferenceEquals(this.Dispatcher, dispatcher), null, "object.ReferenceEquals(this.Dispatcher, dispatcher)");
		}
#endif

		public override IDisposable Schedule<TState>(TState state, TimeSpan dueTime, Func<IScheduler, TState, IDisposable> action)
		{
			return null;
		}
	}
}